package cn.xuguowen.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * ClassName: BaseEntity
 * Package: cn.xuguowen.entity
 * Description:
 *
 * @Author 徐国文
 * @Create 2023/2/26 12:45
 * @Version 1.0
 */
@Data
public class BaseEntity implements Serializable {

    public static final Long serialVersionUID = 1L;

    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateBy;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @TableField(fill = FieldFill.INSERT)
    @TableLogic
    private Integer deleteFlag;     // 逻辑删除

    @TableField(fill = FieldFill.INSERT)
    private Integer version;        // mybatisplus的乐观锁插件

}
